package projeto.comercial.gerenciarservico.cdp;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import nucleo.comuns.util.UtilitarioSerializacao;
import plataforma.base.cdp.ObjetoPersistente;

@Entity
public class CheckList extends ObjetoPersistente{
	
	private static final long serialVersionUID = UtilitarioSerializacao.getIDSerializacao();

	private String descricao;
	private Set<ItemCheckList> itensChecklist = new HashSet<ItemCheckList>();
	
	public CheckList(){
	
	}
	

	/**
	 * @return the descricao
	 */
	@Column(nullable=false)
	public String getDescricao() {
		return descricao;
	}

	/**
	 * @param descricao the descricao to set
	 */
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy("numeroDeOrdemNoChecklist")
	public Set<ItemCheckList> getItensChecklist() {
		return itensChecklist;
	}



	public void setItensChecklist(Set<ItemCheckList> itensChecklist) {
		this.itensChecklist = itensChecklist;
	}

	

}
